﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using SBACN.WebSite.Code;

namespace SBACN.WebSite.UC
{
	public partial class AdminHeader : AdminBaseControl
	{
		protected void Page_Load(object sender, EventArgs e)
		{
			if(!Page.IsPostBack)
			{
				InitCrrl();
			}
		}

		private void InitCrrl()
		{
			if(AdminBasePage.AdminInfo != null)
			{
				this.lbl_AdminInfo.Text = string.IsNullOrEmpty(AdminBasePage.AdminInfo.NickName) ? AdminBasePage.AdminInfo.UserName : AdminBasePage.AdminInfo.NickName;
			}
		}

		protected void lbtn_logout_Click(object sender, EventArgs e)
		{
			Session.Clear();
			Session.Abandon();
			Response.Redirect(BasePage.AdminLoginPage, true);
		}
	}
}